package org.wutopia.labcloud.domain.uaa.service.impl;

import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import org.wutopia.labcloud.domain.uaa.controller.vo.output.UserGetUserOutputVO;
import org.wutopia.labcloud.domain.uaa.dao.UserMainDao;
import org.wutopia.labcloud.domain.uaa.dao.entity.UserMain;
import org.wutopia.labcloud.domain.uaa.service.UserService;


@Service
@AllArgsConstructor
public class UserServiceImpl implements UserService {

    private UserMainDao userMainDao;


    @Override
    public UserGetUserOutputVO getUserById(Long id) {

        UserMain userMain = userMainDao.selectById(id);

        UserGetUserOutputVO vo = new UserGetUserOutputVO();

        vo.setId(userMain.getId());
        vo.setNickname(userMain.getNickname());
        vo.setUsername(userMain.getUsername());
        vo.setAvatarAddr(userMain.getAvatarAddr());

        return vo;
    }
}
